import QUANTAXIS as QA
from QAStrategy.qastockbase import QAStrategyStockBase



class strategy(QAStrategyStockBase):
    def on_bar(self, data):
        print(data)
        print(self.get_positions('000001'))
        print(self.market_data)
        
        code = data.name[1]
        print('---------------under is 当前全市场的market_data --------------')
        
        print(self.get_current_marketdata())
        print('---------------under is 当前品种的market_data --------------')
        print(self.get_code_marketdata(code))
        print(code)
        #print(self.running_time)
        input()

if __name__ == '__main__':
    s = strategy(code=['000001', '000002'], frequence='day', start='2019-01-01', end='2019-02-01', strategy_id='x')
    s.debug()
    """
    
    portfolio with user_cookie  USER_QoZ8TDrF  already exist!!
    < QA_AccountPRO x market: stock_cn>
    stock_cn
    backtest: Settle!
    open      9.390000e+00
    high      9.420000e+00
    low       9.160000e+00
    close     9.190000e+00
    volume    5.393860e+05
    amount    4.986951e+08
    Name: (2019-01-02 00:00:00, 000001), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                    open  high   low  close    volume       amount
    2019-01-02 000001  9.39  9.42  9.16   9.19  539386.0  498695104.0
    ---------------under is 当前全市场的market_data --------------
                    open  high   low  close    volume       amount
    2019-01-02 000001  9.39  9.42  9.16   9.19  539386.0  498695104.0
    ---------------under is 当前品种的market_data --------------
                    open  high   low  close    volume       amount
    2019-01-02 000001  9.39  9.42  9.16   9.19  539386.0  498695104.0
    000001
    
    open      2.383000e+01
    high      2.409000e+01
    low       2.367000e+01
    close     2.390000e+01
    volume    2.470100e+05
    amount    5.893846e+08
    Name: (2019-01-02 00:00:00, 000002), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close    volume       amount
    2019-01-02 000001   9.39   9.42   9.16   9.19  539386.0  498695104.0
            000002  23.83  24.09  23.67  23.90  247010.0  589384576.0
    ---------------under is 当前全市场的market_data --------------
                        open   high    low  close    volume       amount
    2019-01-02 000001   9.39   9.42   9.16   9.19  539386.0  498695104.0
            000002  23.83  24.09  23.67  23.90  247010.0  589384576.0
    ---------------under is 当前品种的market_data --------------
                        open   high    low  close    volume       amount
    2019-01-02 000002  23.83  24.09  23.67   23.9  247010.0  589384576.0
    000002
    
    backtest: Settle!
    open      9.180000e+00
    high      9.330000e+00
    low       9.150000e+00
    close     9.280000e+00
    volume    4.155370e+05
    amount    3.844577e+08
    Name: (2019-01-03 00:00:00, 000001), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close    volume       amount
    2019-01-02 000001   9.39   9.42   9.16   9.19  539386.0  498695104.0
            000002  23.83  24.09  23.67  23.90  247010.0  589384576.0
    2019-01-03 000001   9.18   9.33   9.15   9.28  415537.0  384457696.0
    ---------------under is 当前全市场的market_data --------------
                    open  high   low  close    volume       amount
    2019-01-03 000001  9.18  9.33  9.15   9.28  415537.0  384457696.0
    ---------------under is 当前品种的market_data --------------
                    open  high   low  close    volume       amount
    2019-01-02 000001  9.39  9.42  9.16   9.19  539386.0  498695104.0
    2019-01-03 000001  9.18  9.33  9.15   9.28  415537.0  384457696.0
    000001
    
    open      2.379000e+01
    high      2.450000e+01
    low       2.371000e+01
    close     2.407000e+01
    volume    2.223530e+05
    amount    5.363333e+08
    Name: (2019-01-03 00:00:00, 000002), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close    volume       amount
    2019-01-02 000001   9.39   9.42   9.16   9.19  539386.0  498695104.0
            000002  23.83  24.09  23.67  23.90  247010.0  589384576.0
    2019-01-03 000001   9.18   9.33   9.15   9.28  415537.0  384457696.0
            000002  23.79  24.50  23.71  24.07  222353.0  536333280.0
    ---------------under is 当前全市场的market_data --------------
                        open   high    low  close    volume       amount
    2019-01-03 000001   9.18   9.33   9.15   9.28  415537.0  384457696.0
            000002  23.79  24.50  23.71  24.07  222353.0  536333280.0
    ---------------under is 当前品种的market_data --------------
                        open   high    low  close    volume       amount
    2019-01-02 000002  23.83  24.09  23.67  23.90  247010.0  589384576.0
    2019-01-03 000002  23.79  24.50  23.71  24.07  222353.0  536333280.0
    000002
    
    backtest: Settle!
    open      9.240000e+00
    high      9.820000e+00
    low       9.220000e+00
    close     9.750000e+00
    volume    1.481159e+06
    amount    1.422150e+09
    Name: (2019-01-04 00:00:00, 000001), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
    ---------------under is 当前全市场的market_data --------------
                    open  high   low  close     volume        amount
    2019-01-04 000001  9.24  9.82  9.22   9.75  1481159.0  1.422150e+09
    ---------------under is 当前品种的market_data --------------
                    open  high   low  close     volume        amount
    2019-01-02 000001  9.39  9.42  9.16   9.19   539386.0  4.986951e+08
    2019-01-03 000001  9.18  9.33  9.15   9.28   415537.0  3.844577e+08
    2019-01-04 000001  9.24  9.82  9.22   9.75  1481159.0  1.422150e+09
    000001
    
    open      2.391000e+01
    high      2.500000e+01
    low       2.385000e+01
    close     2.493000e+01
    volume    3.777270e+05
    amount    9.270117e+08
    Name: (2019-01-04 00:00:00, 000002), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    ---------------under is 当前全市场的market_data --------------
                        open   high    low  close     volume        amount
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    ---------------under is 当前品种的market_data --------------
                        open   high    low  close    volume       amount
    2019-01-02 000002  23.83  24.09  23.67  23.90  247010.0  589384576.0
    2019-01-03 000002  23.79  24.50  23.71  24.07  222353.0  536333280.0
    2019-01-04 000002  23.91  25.00  23.85  24.93  377727.0  927011712.0
    000002
    
    backtest: Settle!
    open      9.840000e+00
    high      9.850000e+00
    low       9.630000e+00
    close     9.740000e+00
    volume    8.656870e+05
    amount    8.411664e+08
    Name: (2019-01-07 00:00:00, 000001), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
    ---------------under is 当前全市场的market_data --------------
                    open  high   low  close    volume       amount
    2019-01-07 000001  9.84  9.85  9.63   9.74  865687.0  841166400.0
    ---------------under is 当前品种的market_data --------------
                    open  high   low  close     volume        amount
    2019-01-02 000001  9.39  9.42  9.16   9.19   539386.0  4.986951e+08
    2019-01-03 000001  9.18  9.33  9.15   9.28   415537.0  3.844577e+08
    2019-01-04 000001  9.24  9.82  9.22   9.75  1481159.0  1.422150e+09
    2019-01-07 000001  9.84  9.85  9.63   9.74   865687.0  8.411664e+08
    000001
    
    open      2.529000e+01
    high      2.553000e+01
    low       2.499000e+01
    close     2.505000e+01
    volume    4.271540e+05
    amount    1.077909e+09
    Name: (2019-01-07 00:00:00, 000002), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05   427154.0  1.077909e+09
    ---------------under is 当前全市场的market_data --------------
                        open   high    low  close    volume        amount
    2019-01-07 000001   9.84   9.85   9.63   9.74  865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05  427154.0  1.077909e+09
    ---------------under is 当前品种的market_data --------------
                        open   high    low  close    volume        amount
    2019-01-02 000002  23.83  24.09  23.67  23.90  247010.0  5.893846e+08
    2019-01-03 000002  23.79  24.50  23.71  24.07  222353.0  5.363333e+08
    2019-01-04 000002  23.91  25.00  23.85  24.93  377727.0  9.270117e+08
    2019-01-07 000002  25.29  25.53  24.99  25.05  427154.0  1.077909e+09
    000002
    
    backtest: Settle!
    open      9.730000e+00
    high      9.740000e+00
    low       9.620000e+00
    close     9.660000e+00
    volume    4.023880e+05
    amount    3.892478e+08
    Name: (2019-01-08 00:00:00, 000001), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05   427154.0  1.077909e+09
    2019-01-08 000001   9.73   9.74   9.62   9.66   402388.0  3.892478e+08
    ---------------under is 当前全市场的market_data --------------
                    open  high   low  close    volume       amount
    2019-01-08 000001  9.73  9.74  9.62   9.66  402388.0  389247808.0
    ---------------under is 当前品种的market_data --------------
                    open  high   low  close     volume        amount
    2019-01-02 000001  9.39  9.42  9.16   9.19   539386.0  4.986951e+08
    2019-01-03 000001  9.18  9.33  9.15   9.28   415537.0  3.844577e+08
    2019-01-04 000001  9.24  9.82  9.22   9.75  1481159.0  1.422150e+09
    2019-01-07 000001  9.84  9.85  9.63   9.74   865687.0  8.411664e+08
    2019-01-08 000001  9.73  9.74  9.62   9.66   402388.0  3.892478e+08
    000001
    
    open      2.505000e+01
    high      2.520000e+01
    low       2.463000e+01
    close     2.500000e+01
    volume    2.143820e+05
    amount    5.336044e+08
    Name: (2019-01-08 00:00:00, 000002), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05   427154.0  1.077909e+09
    2019-01-08 000001   9.73   9.74   9.62   9.66   402388.0  3.892478e+08
            000002  25.05  25.20  24.63  25.00   214382.0  5.336044e+08
    ---------------under is 当前全市场的market_data --------------
                        open   high    low  close    volume       amount
    2019-01-08 000001   9.73   9.74   9.62   9.66  402388.0  389247808.0
            000002  25.05  25.20  24.63  25.00  214382.0  533604352.0
    ---------------under is 当前品种的market_data --------------
                        open   high    low  close    volume        amount
    2019-01-02 000002  23.83  24.09  23.67  23.90  247010.0  5.893846e+08
    2019-01-03 000002  23.79  24.50  23.71  24.07  222353.0  5.363333e+08
    2019-01-04 000002  23.91  25.00  23.85  24.93  377727.0  9.270117e+08
    2019-01-07 000002  25.29  25.53  24.99  25.05  427154.0  1.077909e+09
    2019-01-08 000002  25.05  25.20  24.63  25.00  214382.0  5.336044e+08
    000002
    
    backtest: Settle!
    open      9.740000e+00
    high      1.008000e+01
    low       9.700000e+00
    close     9.940000e+00
    volume    1.233486e+06
    amount    1.229465e+09
    Name: (2019-01-09 00:00:00, 000001), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05   427154.0  1.077909e+09
    2019-01-08 000001   9.73   9.74   9.62   9.66   402388.0  3.892478e+08
            000002  25.05  25.20  24.63  25.00   214382.0  5.336044e+08
    2019-01-09 000001   9.74  10.08   9.70   9.94  1233486.0  1.229465e+09
    ---------------under is 当前全市场的market_data --------------
                    open   high  low  close     volume        amount
    2019-01-09 000001  9.74  10.08  9.7   9.94  1233486.0  1.229465e+09
    ---------------under is 当前品种的market_data --------------
                    open   high   low  close     volume        amount
    2019-01-02 000001  9.39   9.42  9.16   9.19   539386.0  4.986951e+08
    2019-01-03 000001  9.18   9.33  9.15   9.28   415537.0  3.844577e+08
    2019-01-04 000001  9.24   9.82  9.22   9.75  1481159.0  1.422150e+09
    2019-01-07 000001  9.84   9.85  9.63   9.74   865687.0  8.411664e+08
    2019-01-08 000001  9.73   9.74  9.62   9.66   402388.0  3.892478e+08
    2019-01-09 000001  9.74  10.08  9.70   9.94  1233486.0  1.229465e+09
    000001
    
    open      2.540000e+01
    high      2.588000e+01
    low       2.511000e+01
    close     2.533000e+01
    volume    3.401400e+05
    amount    8.670814e+08
    Name: (2019-01-09 00:00:00, 000002), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05   427154.0  1.077909e+09
    2019-01-08 000001   9.73   9.74   9.62   9.66   402388.0  3.892478e+08
            000002  25.05  25.20  24.63  25.00   214382.0  5.336044e+08
    2019-01-09 000001   9.74  10.08   9.70   9.94  1233486.0  1.229465e+09
            000002  25.40  25.88  25.11  25.33   340140.0  8.670814e+08
    ---------------under is 当前全市场的market_data --------------
                        open   high    low  close     volume        amount
    2019-01-09 000001   9.74  10.08   9.70   9.94  1233486.0  1.229465e+09
            000002  25.40  25.88  25.11  25.33   340140.0  8.670814e+08
    ---------------under is 当前品种的market_data --------------
                        open   high    low  close    volume        amount
    2019-01-02 000002  23.83  24.09  23.67  23.90  247010.0  5.893846e+08
    2019-01-03 000002  23.79  24.50  23.71  24.07  222353.0  5.363333e+08
    2019-01-04 000002  23.91  25.00  23.85  24.93  377727.0  9.270117e+08
    2019-01-07 000002  25.29  25.53  24.99  25.05  427154.0  1.077909e+09
    2019-01-08 000002  25.05  25.20  24.63  25.00  214382.0  5.336044e+08
    2019-01-09 000002  25.40  25.88  25.11  25.33  340140.0  8.670814e+08
    000002
    
    backtest: Settle!
    open      9.870000e+00
    high      1.020000e+01
    low       9.860000e+00
    close     1.010000e+01
    volume    1.071817e+06
    amount    1.079711e+09
    Name: (2019-01-10 00:00:00, 000001), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05   427154.0  1.077909e+09
    2019-01-08 000001   9.73   9.74   9.62   9.66   402388.0  3.892478e+08
            000002  25.05  25.20  24.63  25.00   214382.0  5.336044e+08
    2019-01-09 000001   9.74  10.08   9.70   9.94  1233486.0  1.229465e+09
            000002  25.40  25.88  25.11  25.33   340140.0  8.670814e+08
    2019-01-10 000001   9.87  10.20   9.86  10.10  1071817.0  1.079711e+09
    ---------------under is 当前全市场的market_data --------------
                    open  high   low  close     volume        amount
    2019-01-10 000001  9.87  10.2  9.86   10.1  1071817.0  1.079711e+09
    ---------------under is 当前品种的market_data --------------
                    open   high   low  close     volume        amount
    2019-01-02 000001  9.39   9.42  9.16   9.19   539386.0  4.986951e+08
    2019-01-03 000001  9.18   9.33  9.15   9.28   415537.0  3.844577e+08
    2019-01-04 000001  9.24   9.82  9.22   9.75  1481159.0  1.422150e+09
    2019-01-07 000001  9.84   9.85  9.63   9.74   865687.0  8.411664e+08
    2019-01-08 000001  9.73   9.74  9.62   9.66   402388.0  3.892478e+08
    2019-01-09 000001  9.74  10.08  9.70   9.94  1233486.0  1.229465e+09
    2019-01-10 000001  9.87  10.20  9.86  10.10  1071817.0  1.079711e+09
    000001
    
    open      2.522000e+01
    high      2.556000e+01
    low       2.503000e+01
    close     2.511000e+01
    volume    2.246490e+05
    amount    5.689526e+08
    Name: (2019-01-10 00:00:00, 000002), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05   427154.0  1.077909e+09
    2019-01-08 000001   9.73   9.74   9.62   9.66   402388.0  3.892478e+08
            000002  25.05  25.20  24.63  25.00   214382.0  5.336044e+08
    2019-01-09 000001   9.74  10.08   9.70   9.94  1233486.0  1.229465e+09
            000002  25.40  25.88  25.11  25.33   340140.0  8.670814e+08
    2019-01-10 000001   9.87  10.20   9.86  10.10  1071817.0  1.079711e+09
            000002  25.22  25.56  25.03  25.11   224649.0  5.689526e+08
    ---------------under is 当前全市场的market_data --------------
                        open   high    low  close     volume        amount
    2019-01-10 000001   9.87  10.20   9.86  10.10  1071817.0  1.079711e+09
            000002  25.22  25.56  25.03  25.11   224649.0  5.689526e+08
    ---------------under is 当前品种的market_data --------------
                        open   high    low  close    volume        amount
    2019-01-02 000002  23.83  24.09  23.67  23.90  247010.0  5.893846e+08
    2019-01-03 000002  23.79  24.50  23.71  24.07  222353.0  5.363333e+08
    2019-01-04 000002  23.91  25.00  23.85  24.93  377727.0  9.270117e+08
    2019-01-07 000002  25.29  25.53  24.99  25.05  427154.0  1.077909e+09
    2019-01-08 000002  25.05  25.20  24.63  25.00  214382.0  5.336044e+08
    2019-01-09 000002  25.40  25.88  25.11  25.33  340140.0  8.670814e+08
    2019-01-10 000002  25.22  25.56  25.03  25.11  224649.0  5.689526e+08
    000002
    
    backtest: Settle!
    open      1.011000e+01
    high      1.022000e+01
    low       1.005000e+01
    close     1.020000e+01
    volume    6.963640e+05
    amount    7.080018e+08
    Name: (2019-01-11 00:00:00, 000001), dtype: float64
    < QAPOSITION 000001 amount 0/0 >
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
            000002  23.83  24.09  23.67  23.90   247010.0  5.893846e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
            000002  23.79  24.50  23.71  24.07   222353.0  5.363333e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
            000002  23.91  25.00  23.85  24.93   377727.0  9.270117e+08
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
            000002  25.29  25.53  24.99  25.05   427154.0  1.077909e+09
    2019-01-08 000001   9.73   9.74   9.62   9.66   402388.0  3.892478e+08
            000002  25.05  25.20  24.63  25.00   214382.0  5.336044e+08
    2019-01-09 000001   9.74  10.08   9.70   9.94  1233486.0  1.229465e+09
            000002  25.40  25.88  25.11  25.33   340140.0  8.670814e+08
    2019-01-10 000001   9.87  10.20   9.86  10.10  1071817.0  1.079711e+09
            000002  25.22  25.56  25.03  25.11   224649.0  5.689526e+08
    2019-01-11 000001  10.11  10.22  10.05  10.20   696364.0  7.080018e+08
    ---------------under is 当前全市场的market_data --------------
                        open   high    low  close    volume       amount
    2019-01-11 000001  10.11  10.22  10.05   10.2  696364.0  708001792.0
    ---------------under is 当前品种的market_data --------------
                        open   high    low  close     volume        amount
    2019-01-02 000001   9.39   9.42   9.16   9.19   539386.0  4.986951e+08
    2019-01-03 000001   9.18   9.33   9.15   9.28   415537.0  3.844577e+08
    2019-01-04 000001   9.24   9.82   9.22   9.75  1481159.0  1.422150e+09
    2019-01-07 000001   9.84   9.85   9.63   9.74   865687.0  8.411664e+08
    2019-01-08 000001   9.73   9.74   9.62   9.66   402388.0  3.892478e+08
    2019-01-09 000001   9.74  10.08   9.70   9.94  1233486.0  1.229465e+09
    2019-01-10 000001   9.87  10.20   9.86  10.10  1071817.0  1.079711e+09
    2019-01-11 000001  10.11  10.22  10.05  10.20   696364.0  7.080018e+08
    """